<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Shopee</title>
    <style type="text/css">
        .disabled {
            color: gray;
        }
    </style>
    <script>
        // 摸拟Shopee重置按钮
        setInterval(function () {
            var btn = document.querySelector(".delete-button");
            btn.classList.add("disabled");
            btn.setAttribute("disabled", "disabled");
            console.log("状态已经重置");
        }, 1500);
    </script>
</head>

<body>
    <div>
        <p>之前代码：<a href="https://www.cnblogs.com/dotnetcrazy/p/10585254.html">小计：Shopee批量删除修复~附脚本</a></p>
    </div>
    <button disabled type="button" class="delete-button disabled">摸拟一下</button>
    <script>
        // shopee每次选中都会重置删除按钮状态
        setInterval(function () {
            var btn = document.querySelector(".delete-button");
            // 只有选择之后才会出现按钮
            if (btn) {
                // 如果包含disabled类就删除
                if (btn.classList.contains("disabled")) {
                    btn.classList.remove("disabled");
                }
                // 如果包含disabled属性
                if (btn.hasAttribute("disabled")) {
                    btn.removeAttribute("disabled");
                }
            }
        }, 1000);
    </script>
</body>

</html>